<div class="box-body">
    <form class="layui-form" action="{:url('/pur/producer/save')}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">供应商名称</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="供应商名称"  name="name" {if isset($producer)}value="{$producer.name}"{/if}  class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">供应商编号</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="供应商编号"  name="code" {if isset($producer)}value="{$producer.code}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">类型</label>
            <div class="layui-input-block">
                <select name="type" lay-verify="required">
                    <option value="">请选择</option>
                    {foreach $line_type as $k => $t}
                    <option value="{$k}" {if isset($producer) && $producer->type==$t}selected{/if}>{$t}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label xrequired">付款方式</label>
            <div class="layui-input-block">
                <select name="pay_type" lay-verify="required">
                    <option value="">请选择</option>
                    {foreach $pay_type as $k => $t}
                    <option value="{$k}" {if isset($producer) && $producer->pay_type==$t}selected{/if}>{$t}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">银行</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="银行"  name="bank" {if isset($producer)}value="{$producer.bank}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">银行账号</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="银行账号"  name="account" {if isset($producer)}value="{$producer.account}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">开户名</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="银行开户名"  name="bank_user" {if isset($producer)}value="{$producer.bank_user}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">银行地址</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="银行地址"  name="bank_address" {if isset($producer)}value="{$producer.bank_address}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">线上平台</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="线上平台"  name="platform" {if isset($producer)}value="{$producer.platform}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">网址</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="网址"  name="site" {if isset($producer)}value="{$producer.site}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">主营商品</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="主营商品"  name="main_product" {if isset($producer)}value="{$producer.main_product}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">预付款百分比</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="预付款百分比"  name="before_pay" {if isset($producer)}value="{$producer.before_pay}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">账期天数</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="账期天数"  name="credit_day" {if isset($producer)}value="{$producer.credit_day}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">交货天数</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="交货天数"  name="delivery_day" {if isset($producer)}value="{$producer.delivery_day}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">供应商质量</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="供应商质量分数"  name="quality" {if isset($producer)}value="{$producer.quality}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系人</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="联系人"  name="contacts" {if isset($producer)}value="{$producer.contacts}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="手机"  name="mobile" {if isset($producer)}value="{$producer.mobile}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="电话"  name="phone" {if isset($producer)}value="{$producer.phone}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">阿里旺旺</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="阿里旺旺"  name="wangwang" {if isset($producer)}value="{$producer.wangwang}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">QQ</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="QQ"  name="qq" {if isset($producer)}value="{$producer.qq}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">供应商地址</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="供应商地址"  name="address" {if isset($producer)}value="{$producer.address}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备用联系人</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="备用联系人"  name="spare_contacts" {if isset($producer)}value="{$producer.spare_contacts}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备用手机</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="备用联系人手机"  name="spare_mobile" {if isset($producer)}value="{$producer.spare_mobile}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备用电话</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="备用联系人电话"  name="spare_phone" {if isset($producer)}value="{$producer.spare_phone}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备用QQ</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="备用联系人QQ"  name="spare_qq" {if isset($producer)}value="{$producer.spare_qq}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="number" autocomplete="off" placeholder="排序"  name="sort" {if isset($producer)}value="{$producer.sort}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" autocomplete="off" placeholder="备注"  name="remark" {if isset($producer)}value="{$producer.remark}"{/if} class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="checkbox" name="status" value="1" {if !isset($producer) || (isset($producer) && $producer.status=='1')}checked{/if} lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否开发票</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_invoice" value="1" {if isset($producer) && $producer.is_invoice==1}checked{/if} lay-skin="switch">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否含税</label>
            <div class="layui-input-block">
                <input type="checkbox" name="is_free_tax" value="1" {if isset($producer) && $producer.is_free_tax==1}checked{/if} lay-skin="switch">
            </div>
        </div>
        {if isset($producer)}
        <input type="hidden" name="producer_id" value="{$producer.producer_id}">
        {/if}
    </form>
</div>